Skip to content

Conversation

hamzaremmal
Copy link
Member

With the new stdlib fully compiled with Scala 3, we get the following warning in the test suite before this change

 at 109: Cyclic initialization: object Predef -> object Manifest -> object ManifestFactory -> object Predef. Calling trace:
├── object Manifest {	[ Manifest.scala:76 ]
   ^
├── val Byte: ManifestFactory.ByteManifest = ManifestFactory.Byte	[ Manifest.scala:86 ]
                                            ^^^^^^^^^^^^^^^
├── object Predef extends LowPriorityImplicits {	[ Predef.scala:109 ]
   ^
├── val Manifest          = scala.reflect.Manifest	[ Predef.scala:210 ]
                           ^^^^^^^^^^^^^^^^^^^^^^
├── object ManifestFactory {	[ Manifest.scala:171 ]
   ^
└── private[this] val ObjectTYPE = classOf[java.lang.Object]	[ Manifest.scala:323 ]

Since Predef.classOf is magic, we can safely ignore these fields in the init checker.

…nifestFactory`

We get the following warning in the test suite before this change

```scala
 at 109: Cyclic initialization: object Predef -> object Manifest -> object ManifestFactory -> object Predef. Calling trace:
├── object Manifest {	[ Manifest.scala:76 ]
│   ^
├── val Byte: ManifestFactory.ByteManifest = ManifestFactory.Byte	[ Manifest.scala:86 ]
│                                            ^^^^^^^^^^^^^^^
├── object Predef extends LowPriorityImplicits {	[ Predef.scala:109 ]
│   ^
├── val Manifest          = scala.reflect.Manifest	[ Predef.scala:210 ]
│                           ^^^^^^^^^^^^^^^^^^^^^^
├── object ManifestFactory {	[ Manifest.scala:171 ]
│   ^
└── private[this] val ObjectTYPE = classOf[java.lang.Object]	[ Manifest.scala:323 ]
```
@hamzaremmal hamzaremmal changed the title fix: avoid cyclic initialisation between Predef, Manifest and ManifestFactory fix: avoid cyclic initialisation *warning* between Predef, Manifest and ManifestFactory Sep 11, 2025
Copy link
Contributor

@liufengyun liufengyun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@hamzaremmal hamzaremmal merged commit 4bbd5b3 into scala:main Sep 12, 2025
44 checks passed
@hamzaremmal hamzaremmal deleted the stdlib-init branch September 12, 2025 07:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants